package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.vo.SysWhitePaperTaskVo;
import com.ruoyi.system.service.ISysWhitePaperSurveyTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 白皮书调研任务Controller
 *
 * @author ruoyi
 * @date 2025-10-20
 */
@RestController
@RequestMapping("/system/task")
public class SysWhitePaperSurveyTaskController extends BaseController
{
    @Autowired
    private ISysWhitePaperSurveyTaskService sysWhitePaperSurveyTaskService;

    /**
     * 查询白皮书调研任务列表
     */
    @GetMapping("/list")
    public AjaxResult list(Long projectId)
    {
        List<SysWhitePaperTaskVo> list = sysWhitePaperSurveyTaskService.selectSysWhitePaperSurveyTaskList(projectId);
        return success(list);
    }

    /**
     * 开始任务
     */
    @GetMapping("/start")
    public AjaxResult start(Long projectId)
    {
        sysWhitePaperSurveyTaskService.startTask(projectId);
        return success();
    }
}
